package com.bupt.kgplatform.mapper;


import com.bupt.kgplatform.entity.pojo.CtbtoInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName:ctbtoSql
 * Package:com.example.blackjavaweb.mapper
 * Description:sql中ctbto检索
 *
 * @Author QIQI_1999
 * @Creat 2023/10/15 22:22
 * @Version 1.0
 */
@Mapper
public interface CtbtoSql {

    @Select("select label, data, title, title_, filename, cat_txt, type from ctbto_document limit #{start},#{num}")
    List<CtbtoInfo> getall(int start, int num);


    @Select("select label, data, title, title_, filename, cat_txt, type from ctbto_document where label like  CONCAT('%', #{content_english}, '%')  or title like   CONCAT('%', #{content_english}, '%') limit #{start},#{pagenum}")
    List<CtbtoInfo> getInfoByCon(String content_english, int start, int pagenum);

    @Select("select count(*) from ctbto_document")
    int getallnum();

    @Select("select count(*) from ctbto_document where label like  CONCAT('%', #{content_english}, '%')  or title like   CONCAT('%', #{content_english}, '%')")
    int getNumByCon(String content_english);
}
